// 转换json到formData
export const convertObject2FormData = <T extends Record<string, any>>(
  obj: T
): FormData => {
  const formData = new FormData();
  for (const key in obj) {
    if (Object.prototype.hasOwnProperty.call(obj, key)) {
      const value = obj[key];
      if (value) {
        formData.append(key, String(value));
      }
    }
  }
  return formData;
};
